.\" $Id: PAPI_lock.3,v 1.8 2004/09/30 17:26:09 london Exp $
.TH "PAPI_lock" 3 "September, 2004" "PAPI Programmer's Reference" "PAPI"

.SH NAME
PAPI_lock \- Lock one of two mutex variables defined in papi.h
 PAPI_unlock \- Unlock one of the mutex variables defined in papi.h

.SH SYNOPSIS
.B C Interface
.nf
.B #include <papi.h>
.BI void\ PAPI_lock(int lock);
.BI void\ PAPI_unlock(int lock);
.fi
.B Fortran Interface
.nf
.B #include "fpapi.h"
.BI PAPIF_lock(C_INT\  lock)
.BI PAPIF_unlock(C_INT\  lock)
.fi

.SH DESCRIPTION
.B "PAPI_lock()"
Grabs access to one of the two PAPI mutex variables. This function is provided to the 
user to have a platform independent call to  (hopefully) efficiently
implemented mutex.
.LP
.B "PAPI_unlock()"
unlocks the mutex acquired by a call to
.BR PAPI_lock .

.SH ARGUMENT
.I lock
--  an integer value specifying one of the two user locks: 
.B "PAPI_USR1_LOCK" or "PAPI_USR2_LOCK"

.SH RETURN VALUES
There are no return values for these calls. Upon return from
.B PAPI_lock
the current thread has acquired exclusive access to the specified PAPI mutex.

.SH BUGS
These functions have no known bugs.

.SH SEE ALSO
.BR PAPI_thread_init "(3)"
